GLRex - OpenGL,Renderman Explorer

 

Documentation

GLRex Demos

RIB Demos

MS code in ms.zip

Linux code in linux.zip

 

GLRex is an interactive graphics code generator. It is designed to provide the student  interested in learning graphics programming with a source of simple examples of RenderMan RIB files, and OpenGL C programs. 

GLRex (rhymes with T rex)  functions as a simple modeling tool that allows the user to create scenes using basic graphics primitives (cube, sphere, cylinder, and cone), as well as NURB surfaces (surfaces of revolution and extrusions). These scenes can then be exported as either:

C code that can be run using OpenGL

or as

RenderMan Interface Binary files (.rib) for rendering with a RenderMan compliant renderer.

 

The exported code  provides the user-student with both nontrivial programming examples as well as code that can serve as a basis for experimenting with more advanced programming techniques. I expect that the student will use the exported code as a basis for experimenting applying more advanced programming techniques in OpenGL and RenderMan.


 GLRex is not intended to be a full featured  modeler. Generally features were chosen to make the  interface as simple as possible. I did not want the user to have to spend much time learning how to use GLRex itself. Hopefully a user will be comfortable with GLRex in less than an hour.

 GLRex is written in C, using the OpenGL graphics library and GLUT (the OpenGL Utility Toolkit) . GLUT was written by Mark Kilgard, and ported to Windows by Nate Robbins. GLUT is copyrighted, but is freely distributable. The code for GLRex is cross platform and should run on any system with little or no tweaking. I myself have only used it under Linux and MS windows.

 

X Windows

Open this zip file linux.zip. You will find a makefile and two subdirectories src and include. Run the makefile. The executable will be put in the src directory. It is preferable to run the executable from a shell rather than by clicking on the executable’s icon.
 

MS Windows

To run GLRex you only need two files: glrex.exe and glut32.dll.
The  glut32.dll file must be either in the same directory as the GLRex exe file or in a system directory. (Hint: Locate the file opengl32.dll and put glut32.dll in the same directory.)
In my experience there are a few  hardware configurations in which glut32.dll does not work particularly well. Obviously GLRex will not work very well in these configurations either.

To run the C source code exported by GLRex you must create a VC++ project, including both the exported code and glut32.lib in your project. You also need to put the file nurbUtil.h in the same directory as the source code. This file contains the utility functions used for creating NURB surfaces.

If for some reason you want to compile the source code yourself, it has been provided in ms.zip. Use VC++ to compile it. The I/O features of GLRex were implemented using the directory “dirent.h”. This is a system directory in X windows but not in VC++. The MS windows version of GLRex uses a cross platform version of “dirent.h” written by Toni Ronkko.

 

Running RIB Files

To run the rib files generated by GLRex you will need a RenderMan compliant renderer (there are some free ones out there - check out 3Delight). One of the two default light shaders used by GLRex is point light with no distance fall off. Here is the source code for that shader newlight.sl

A sample code segment file is also available sample2.rcf.

Warning

GLRex creates 2 files while it is running - backup.ses and active.rcf. These files are put in the same directory as the glrex executable.

The contents of this web site are provided "as is" without warranty of any kind, either express or implied, including, but not limited to, the implied warranties of merchantability, fitness for a particular purpose, or non-infringement.

I cannot be responsible for any damage the software on this site may cause to your files or computer.

GLRex is copyrighted 2004 by Gerard McDonald. I retain all creative rights.
The software may not be used for any commercial purpose without my permission.